<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue示例</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.40/vue.global.js"></script>
</head>

<body>
    <div id="app">
        <!-- <div @click="myClick">123
            <button v-on:click.stop="clickCallback($event,1)">点我</button>
        </div>

        <a href="https://www.baidu.com/" @click.prevent="">百度</a> -->
        <hr>

        <div @click.capture.self.once="showMsg(1)">box1
            <div @click="showMsg(2)">box2</div>
        </div>
        <hr>
        <input @keyup.13="onEnter" v-model="myValue"/>
        <span v-pre>{{ this will not be compiled }}</span>
    </div>
    <script>
        const {ref} =Vue
        const app = Vue.createApp({
            setup(props) {

                const myValue= ref('')
                function clickCallback(event,a) {
                    console.log(event.target);
                    console.log(a);
                }
                function myClick(params) {
                    console.log('myClick');
                }
                function showMsg(params) {
                    console.log(params);
                }
                function onEnter(params) {
                    console.log(myValue.value);
                }
                return {
               
                    clickCallback,myClick,showMsg,onEnter,myValue
                }
            }
        }).mount("#app");
    </script>
</body>

</html>